var t = getApp();

Page({
    data: {
        latest_list: [],
        picture_list: [],
        video_list: [],
        default_logo: "",
        pic_src_list: []
    },
    onLoad: function(t) {
        this.getData();
    },
    onReady: function() {},
    getData: function() {
        var e = this, a = t.getNetAddresss("plugin.present-project.frontend.project.index");
        t._getNetWork({
            url: a,
            data: {},
            success: function(a) {
                var n = a.data;
                if (1 != n.result) return t.tips(n.msg);
                var o = [], i = [], r = [];
                n.data.project_img_list.forEach(function(t) {
                    10 != o.length && t.change_img.forEach(function(e) {
                        if (10 != o.length) {
                            var a = {
                                name: t.title,
                                url: e
                            };
                            o.push(a), r.push(e);
                        }
                    });
                }), n.data.project_video_list.forEach(function(t) {
                    10 != i.length && t.change_video.forEach(function(e) {
                        if (10 != i.length) {
                            var a = {
                                name: t.title,
                                url: e
                            };
                            i.push(a);
                        }
                    });
                }), e.setData({
                    latest_list: n.data.latest_list,
                    picture_list: o,
                    video_list: i,
                    pic_src_list: r,
                    default_logo: n.data.default_logo
                });
            }
        });
    },
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {},
    gotoPage: function(t) {
        var e = t.currentTarget.dataset.name, a = "/packageI/donation_project/".concat(e, "/").concat(e);
        wx.navigateTo({
            url: a
        });
    },
    getDetails: function(t) {
        var e = t.currentTarget.dataset.id, a = "/packageI/donation_project/donationProjectDetails/donationProjectDetails?id=".concat(e);
        wx.navigateTo({
            url: a
        });
    },
    handImagePreview: function(t) {
        var e = t.currentTarget.dataset.src;
        wx.previewImage({
            urls: [ e ]
        });
    },
    handPictureImagePreview: function(t) {
        var e = t.currentTarget.dataset.src;
        console.log(e), wx.previewImage({
            urls: this.data.pic_src_list,
            current: e
        });
    }
});